<!--
 * @Author: weidewei
 * @Date: 2025-05-13 16:57:45
 * @LastEditors: weidewei
 * @LastEditTime: 2025-05-13 17:34:58
 * @Description: 
 * @FilePath: \2025-front-face\vue\vue2\v2\src\components\TestPropComp.vue
-->
<template>
    <div>
        <h3>子组件props接收到的参数: {{ user }}</h3>
        <h3>子组件attrs接收到的参数: {{ $attrs }}</h3>
    </div>
</template>
<script>
    export default {
        name: "TestPropComp",
        data() {
            return {
                
            }
        },
        mounted() {
           console.log(this.$attrs) 
        },  
        // 数组写法
        // props: ["user"]
        // 对象写法
        props: {
            user: {
                type: Object,
                default: () => ({}),
                required: true // props的必填校验
            }
        }
    }
</script>